<?php
 /*******************************************************************************
 * @filename: changepass.ctp
 *
 * @author: immer_baldos
 *
 * @description: user/changepass view
 *
 * @history:
 *
 *   VERSION   DATE                   BY          NOTES
 *  ---------------------------------------------------------------
 *     1.0     September 21, 2009     immer       initial implementation
 *
 ******************************************************************************/
 ?>
<div class="users form">
<?php echo $form->create('User', array('action'=>'changepass'));?>
	<fieldset>
        <legend><?php __('Change Password');?></legend>
	<?php
		echo $form->input('id');
		echo $form->input('username', array('disabled'=>true));
		echo $form->input('password',array('value'=>''));
		echo $form->input('password2',array('label'=>'Re-enter Password','type'=>'password','value'=>''));
		echo $form->hidden('old_password');
		$myStamp=getdate();
		echo $form->hidden('date_changed',array('type'=>'text','value'=>sprintf("%s-%'02s-%'02s",$myStamp['year'],$myStamp['mon'],$myStamp['mday'])));

		if ($_SESSION['Auth']['User']['role'] == "admin"){
		    echo $form->input('role', array('options' => array(
                'admin',
                'finance',
                'collector',
                'product officer',
                'sales',
                'customer'
            ), 'selected' => $role));
        }else{
            echo $form->hidden('role', array('options' => array(
                'admin',
                'finance',
                'collector',
                'product officer',
                'sales',
                'customer'
            ), 'selected' => $role));
        }
	?>
	</fieldset>
<?php echo $form->end('Submit');?>
</div>
